From abe91ee55b7b6977748de071eb2e862b51c7e820 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 21 Oct 2003 13:48:27 +0000 Subject: [PATCH] defs.h: Add fields for Mark. cetus.c: Add option to append icon description to description. --- gpsbabel/cetus.c | 19 ++++++++++++++++--- gpsbabel/defs.h | 14 ++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/gpsbabel/cetus.c b/gpsbabel/cetus.c index 817bbd5e0..9d9ebb374 100644 --- a/gpsbabel/cetus.c +++ b/gpsbabel/cetus.c @@ -80,10 +80,13 @@ struct pdb_record *opdb_rec; static void *mkshort_wr_handle; static char *dbname = NULL; +static char *appendicon = NULL; static arglist_t cetus_args[] = { {"dbname", &dbname, "Database name", ARGTYPE_STRING }, + {"appendicon", &appendicon, "Append icon_descr to description.", + ARGTYPE_BOOL }, {0, 0, 0, 0 } }; @@ -263,14 +266,24 @@ cetus_writewpt(waypoint *wpt) else { vdata[0] ='\0'; } + if (appendicon && wpt->icon_descr) { + int left = 500 - strlen( vdata ); + int ilen = strlen( wpt->icon_descr ); + if (ilen && left > (ilen+3)) { + strcat( vdata, " (" ); + strcat( vdata, wpt->icon_descr ); + strcat( vdata, ")" ); + } + } vdata += strlen( vdata ) + 1; if ( wpt->notes ) { - strncpy( vdata, wpt->notes, 501 ); - vdata[500] = '\0'; + /* RER note: this doesn't seem to be viewable in Cetus 1.2b2 */ + strncpy( vdata, wpt->notes, 501 ); + vdata[500] = '\0'; } else { - vdata[0] ='\0'; + vdata[0] ='\0'; } vdata += strlen( vdata ) + 1; diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 979df3492..8203de7cd 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -133,6 +133,20 @@ typedef struct xml_tag { typedef struct { queue Q; position position; + + /* + * The "thickness" of a waypoint; adds an element of 3D. Can be + * used to construct rudimentary polygons for, say, airspace + * definitions. + */ + double depth; + + /* + * An alarm trigger value that can be considered to be a circle + * surrounding a waypoint (or cylinder if depth is also defined) + */ + double proximity; + /* shortname is a waypoint name as stored in receiver. It should * strive to be, well, short, and unique. Enforcing length and * character restrictions is the job of the output. A typical -- 2.30.2